/**
 * Created by yumeng on 2017/11/25.
 */
define([
  './themes/lang/' + window.YUFP_SYS_CONFIG.language + '/pages/example/package/elSelect.js'
], function (require, exports) {
  // page加载完成后调用ready方法
  exports.ready = function (hashCode, data, cite) {
    var height = yufp.custom.viewSize().height;
    // 创建virtual model
    yufp.custom.vue({
      el: '#el_select_x_demo',
      data: {
        height: height,
        selected: '',
        // 属性说明，实际使用时不需要此部分
        currClickNode: '',
        setSelected: '',
        setSelectedItem: '',
        options1: [{'key': 1, 'value': 'ssss'}],
        grid: {
          data1: [
            {name: 'multiple', remark: this.$t('elSelect.sfzcdx'), type: 'Boolean', option: '—', default: 'false'},
            {name: 'disabled', remark: this.$t('elSelect.sfjyzj'), type: 'Boolean', option: '—', default: 'false'},
            {name: 'multiple-limit', remark: this.$t('elSelect.xzdxddsrgs'), type: 'Number', option: '—', default: '0'},
            {name: 'size', remark: this.$t('elSelect.srkcc'), type: 'String', option: '—', default: '—'},
            {name: 'name', remark: this.$t('elSelect.zjmc'), type: 'String', option: '—', default: 'el-select-x'},
            {name: 'clearable', remark: this.$t('elSelect.dxssfkyqkxx'), type: 'Boolean', option: '—', default: 'true'},
            {name: 'placeholder', remark: this.$t('elSelect.zwf'), type: 'String', option: '—', default: '—'},
            {name: 'filterable', remark: this.$t('elSelect.sfkss'), type: 'Boolean', option: '—', default: 'true'}
          ],
          data2: [
            {name: 'getSelectdText', remark: this.$t('elSelect.hqxzdz'), param: '—'},
            {name: 'getSelectdValue', remark: this.$t('elSelect.hqxzdz'), param: '—'},
            {name: 'setSelectdByItem', remark: this.$t('elSelect.tgszszxzdz'), param: this.$t('elSelect.wxlxxszxb')},
            {name: 'setSelectdByValue', remark: this.$t('elSelect.tgszxzdz'), param: this.$t('elSelect.wxyszxzdxlkdz')}
          ],
          data3: [
            {name: 'change', remark: this.$t('elSelect.sjdy'), param: this.$t('elSelect.xzdz')}
          ]
        }
      },
      methods: {
        showValFn: function (val) {
          alert(this.$t('elSelect.sj') + val);
        },
        getSelectdText: function () {
          this.$alert(this.$refs.mySelect.getSelectdText());
        },
        getSelectdValue: function () {
          this.$alert(this.$refs.mySelect.getSelectdValue());
        },
        resetSelect: function () {
          this.$refs.mySelect.clear();
        },
        setSelectdByValue: function () {
          this.$refs.mySelect.setSelectdByValue(this.setSelected);
        },
        setSelectdByItem: function () {
          this.$refs.mySelect.setSelectdByItem(this.setSelectedItem);
        }
      }
    });
  };

  // 消息处理
  exports.onmessage = function (type, message) {

  };

  // page销毁时触发destroy方法
  exports.destroy = function (id, cite) {

  };
});
